package com.mjh.zhujianju.enums;

public enum EducationEnum {
	
	DOCTOR("1","博士"),
	POSTGRADUATE("2","研究生"),
	BACHELOR("3","大学本科"),
	COLLEGE("4","大专"),
	HIGH_CHOOL("5","高中");

    private String code;
    private String name;

    EducationEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static EducationEnum[] getEnums(){
        return EducationEnum.values();
    }

    public static String getName(String code){
        if(code == null){
            return null;
        }

        for (EducationEnum EducationEnum : EducationEnum.values()){
            if(code.equals(EducationEnum.getCode())){
                return EducationEnum.getName();
            }
        }

        return null;
    }
}
